<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page import="net.tribal.comic.entities.User" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title><g:message code="title.user.show.nav"/></title>
    </head>
    <body>
		<div class="navButtonsTop rounded-corners">
			<h1 class="title"><g:message code="title.user.show" args="[userInstance.alias]"/></h1>
		</div>	
		<div class="element">

			<div class="image">
				<img src="${resource(file:userInstance?.pathFileThumbnail)}"/>
			</div>
			
			<div class="table rounded-corners">
               	<table>
	                <tbody>
	                	<usr:isAdmin>
		                	<tr>
		                         <td class="name"><g:message code="default.label.id"/>:</td>
		                         <td class="value">${fieldValue(bean: userInstance, field: "id")}</td>
		                    </tr>
		                    <tr>
								<td class="name"><g:message code="default.label.disabled"/>:</td>
		                        <td class="value"><g:formatBoolean boolean="${userInstance?.disabled}" /></td>
		                    </tr>
		                    <tr>
								<td class="name"><g:message code="default.label.dateCreated"/>:</td>
		                        <td class="value"><g:formatDate format="dd-MM-yyyy" date="${userInstance?.dateCreated}" /></td>
		                    </tr>
		                    <tr>
								<td class="name"><g:message code="default.label.lastUpdaded"/>:</td>
		                        <td class="value"><g:formatDate format="dd-MM-yyyy" date="${userInstance?.lastUpdated}" /></td>
		                    </tr>
	                	</usr:isAdmin>
	                	<tr>
	                        <td class="name"><g:message code="default.label.alias"/>:</td>
	                        <td class="value">${fieldValue(bean: userInstance, field: "alias")}</td>
	                    </tr>
	                	<usr:isUser>
		                    <tr>
		                        <td class="name"><g:message code="default.label.fullName"/>:</td>
		                        <td class="value">${fieldValue(bean: userInstance, field: "fullName")}</td>
		                    </tr>
		                    <tr>
		                        <td class="name"><g:message code="default.label.birthDate"/>:</td>
		                        <td class="value"><g:formatDate format="dd-MM-yyyy" date="${userInstance?.birthDate}" /></td>
		                    </tr>
		                    <tr>
		                        <td class="name"><g:message code="default.label.country"/>:</td>
		                        <td class="value"><g:country code="${userInstance.country}"/></td>
		                    </tr>
		                    <tr>
		                        <td class="name"><g:message code="default.label.age"/>:</td>
		                        <td class="value">${fieldValue(bean: userInstance, field: "age")}</td>
		                    </tr>
		                    <tr>
		                        <td class="name"><g:message code="default.label.email"/>:</td>
		                        <td class="value">${fieldValue(bean: userInstance, field: "email")}</td>
		                    </tr>
		                    <tr>
					            <td class="name"><g:message code="default.label.commentable"/>:</td>
					            <td class="value"><g:formatBoolean boolean="${userInstance?.commentable}"/></td>
					        </tr>
					        <tr>
					            <td class="name"><g:message code="default.label.rateable"/>:</td>
					            <td class="value"><g:formatBoolean boolean="${userInstance?.rateable}"/></td>
					        </tr>
						</usr:isUser>
	                </tbody>
	            </table>
	        </div>
	        <div class="rating">
	        	<g:if test="${userInstance.rateable}">
	        		<div id="average-rating">
						<label><g:message code="default.label.rating" />:</label> <g:render template="/rate/rate" model="[instance:userInstance]"/>
					</div>
					<usr:itsNotMine target="${userInstance.id}">
						<div id="your-rating">
							<label><g:message code="default.label.rate.yours" />:</label> <g:render template="/rate/rateCustom" model="[instance:userInstance]"/>
						</div>
					</usr:itsNotMine>
				</g:if>
			</div>
        </div>    
		<div class="navButtons rounded-corners">
			<g:render template="/user/buttons"></g:render>
    	</div>
    </body>
</html>